FROM nginx:stable-alpine-slim

WORKDIR /app

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& sed -i 's/#http/http/g' /etc/apk/repositories \
&& apk update && apk upgrade

RUN apk add php php-common php-session php-mbstring php-opcache php-fpm git && \
    cd /app && git clone https://gitee.com/yhssdl/navigate.git && \
    mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.bak && \
    apk del git && \
    chmod 777 /app/navigate/image && chmod -R 777 /app/navigate/setup

RUN  rm -rf /app/navigate/.git
COPY docker-entrypoint.sh /
COPY nav.conf /etc/nginx/conf.d/

ENTRYPOINT ["sh","/docker-entrypoint.sh"]

# 定义容器启动时执行的命令
#CMD ["nginx"]